﻿@model YogaStudio.Data.Domain.Product

@{
    ViewBag.Title = "Create";
}

<div class="main">
    <div class="content">
        <div class="section group">
            <div class="col span_2_of_3">
                <div class="contact-form">
                    <h3>Product Add / Update</h3>
                    @using (Html.BeginForm("Create", "ProductAdmin", null, FormMethod.Post,
                        new {enctype = "multipart/form-data"}))
                    {
                        @Html.AntiForgeryToken()
                        <div>
                            <span>@Html.LabelFor(model => model.CategoryId, "CategoryId", new {@class = "control-label col-md-2"})</span>
                            <span class="col-md-10">
                                @Html.DropDownList("CategoryId", String.Empty)
                                @Html.ValidationMessageFor(model => model.CategoryId)
                            </span>
                        </div>
                        
                        <div >
                            <span>
                                @Html.LabelFor(model => model.ProductName, new { @class = "control-label col-md-2" })</span>
                            <span class="col-md-10">
                                @Html.EditorFor(model => model.ProductName)
                                @Html.ValidationMessageFor(model => model.ProductName)
                            </span>
                        </div>

                        <div >
                            <span>@Html.LabelFor(model => model.Description, new {@class = "control-label col-md-2"})</span>
                            <span class="col-md-10">
                                @Html.EditorFor(model => model.Description)
                                @Html.ValidationMessageFor(model => model.Description)
                            </span>
                        </div>

                        <div class="form-group">
                            <span>
                                @Html.LabelFor(model => model.SearchAttributes, new { @class = "control-label col-md-2" })</span>
                            <span class="col-md-10">
                                @Html.EditorFor(model => model.SearchAttributes)
                                @Html.ValidationMessageFor(model => model.SearchAttributes)
                            </span>
                        </div>

                        <div class="form-group">
                            <span>
                                @Html.LabelFor(model => model.ImageUrl, new { @class = "control-label col-md-2" })</span>
                            <span class="col-md-10">
                                <input id="ImageUrl" title="Upload a product image" type="file" name="file" />
                                @Html.ValidationMessageFor(model => model.ImageUrl)
                            </span>
                        </div>

                        <div class="form-group">
                            <span>
                                @Html.LabelFor(model => model.Price, new { @class = "control-label col-md-2" })</span>
                            <span class="col-md-10">
                                @Html.EditorFor(model => model.Price, new { @class = "textbox" })
                                @Html.ValidationMessageFor(model => model.Price)
                            </span>
                        </div>

                        <div class="form-group">
                            <span>
                                @Html.LabelFor(model => model.IsAvailable, new { @class = "control-label col-md-2" })</span>
                            <span class="col-md-10">
                                @Html.EditorFor(model => model.IsAvailable)
                                @Html.ValidationMessageFor(model => model.IsAvailable)
                            </span>
                        </div>
                        <div class="form-group">
                                <div class="col-md-offset-2 col-md-10">
                                    <input type="submit" value="Save" class="btn btn-default" />
                                    @Html.ActionLink("Back to List", "Index", null, new { @class = "btn", @id = "bluebck" })
                                </div>
                            </div>
                        
                    }     
                        
                </div>
            </div>
        </div>
    </div>
    
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}